home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 443_01 / doc / info / cncl.info-6 < prev    next >
Encoding:
GNU Info File  |  1996-01-04  |  48.8 KB  |  1,849 lines

  1. This is Info file cncl.info, produced by Makeinfo-1.63 from the input
  2. file cncl.texi.
  3.  
  4.    This file documents the use of CNCL, the Communication Networks Class
  5. Library.
  6.  
  7.    Copyright (C) 1993-1996, Communication Networks.
  8.  
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided that the
  15. entire resulting derived work is distributed under the terms of a
  16. permission notice identical to this one.
  17.  
  18.    Permission is granted to copy and distribute translations of this
  19. manual into other languages, under the above conditions for modified
  20. versions.
  21.  
  22. 
  23. File: cncl.info,  Node: EZDWindow,  Next: EZDDiagWin,  Prev: EZDPushButton,  Up: EZD Interface
  24.  
  25. EZDWindow -- Interface to EZD Window
  26. ====================================
  27.  
  28. SYNOPSIS
  29. --------
  30.  
  31.    `#include<CNCL/EZDWindow>'
  32.  
  33. TYPE
  34. ----
  35.  
  36.    `CN_EZDWINDOW'
  37.  
  38. * Menu:
  39.  
  40. BASE CLASSES
  41. ------------
  42. * EZD::                 Base Class for EZD Graphic Objects
  43.  
  44. DERIVED CLASSES
  45. ---------------
  46.  
  47. RELATED CLASSES
  48. ---------------
  49. * EZDObject::           Interface to EZD Objects
  50. * EZDDrawing::          Interface to EZD Drawings
  51. * EZDPushButton::       Interface to EZD Push-Button
  52.  
  53. DESCRIPTION
  54. -----------
  55.  
  56. With EZD a drawing can only be displayed when it is mapped into a
  57. window. For this, `EZDWindow' creates named windows and maps drawings
  58. into it.  The window is always displayed in the upper left corner of the
  59. screen and is `w_width' pixels wide and `w_heigth' pixels high. The
  60. background color is white and the foreground color is black.
  61. Note: If the named window already exists, the old window is deleted.
  62. Windows are only visible if drawings are displayed in them.
  63. Constructors:
  64.  
  65. `EZDWindow();'
  66. `EZDWindow(CNParam *param);'
  67. `EZDWindow(int w, int h);'
  68. `EZDWindow(int x, int y, int w, int h);'
  69. `EZDWindow(const CNString &name, int w, int h);'
  70. `EZDWindow(const CNString &name, int x, int y, int w, int h);'
  71. `EZDWindow(const CNString &name, const CNString &title, int w, int h)'
  72. `EZDWindow(const CNString &name, const CNString &title, int x, int y, int w, int h);'
  73.      Creates the window named `name' (default: "win") with the title
  74.      `title' (default setting equals `name'). The window is `w' pixels
  75.      wide (default: 200) and `h' pixels high (default: 200). It is
  76.      positioned at the coordinates `(x,y)' (default: (-1,-1)).
  77. Destructor:
  78. `~EZDWindow();'
  79.      Deinitilizes (deletes) the current window.
  80. In addition to the member functions required by CNCL, `EZDWindow'
  81. provides:
  82.  
  83. `int heigth() const;'
  84. `int width() const;'
  85. `int wherex() const;'
  86. `int wherey() const;'
  87.      Returns the width, heigth or (x,y) position of the current window.
  88.  
  89. `void overlay(EZDDrawing *d);'
  90. `void underlay(EZDDrawing *d);'
  91.      Overlays/undelays the drawing `d' over the existing drawings in the
  92.      current window.
  93.  
  94. `void scale_drawing(EZDDrawing *draw, const int origin_x, const int origin_y, const float d_scale_x, const float d_scale_y, const int scale_linewidth);'
  95.      Maps the drawing`draw' with a cartesian coordinate system onto the
  96.      current window. The `origin_(x,y)' parameters specifie the size of
  97.      the origin coordinate system, `d_scale_(x,y)' and
  98.      `scale_linewidth' are the scaling factors.
  99.  
  100. `void set_zoom(EZDDrawing *, const float factor);'
  101.      Zooms the drawing by `factor'.
  102.  
  103. `void set_norm(EZDDrawing *);'
  104.      Sets the drawing back to normalsize.
  105.  
  106. `void set_auto_resize(const int nargs, EZDDrawing * ...);'
  107.      Resizes all drawings of the argument. `nargs' is the number of
  108.      arguments.
  109.  
  110. `void delete_drawing(EZDDrawing *d);'
  111.      Deltes the drawing `d' in the current window.
  112.  
  113. `void print_window(const CNString &filename);'
  114.      Prints the current window as a postscript file on disk.
  115.  
  116. 
  117. File: cncl.info,  Node: EZDDiagWin,  Next: EZDTextWin,  Prev: EZDWindow,  Up: EZD Interface
  118.  
  119. EZDDiagWin -- Extra window with x-y diagram
  120. ===========================================
  121.  
  122. SYNOPSIS
  123. --------
  124.  
  125.    `#include <CNCL/EZDDiagWin.h>'
  126.  
  127. TYPE
  128. ----
  129.  
  130.    `CN_EZDDIAGWIN'
  131.  
  132. * Menu:
  133.  
  134. BASE CLASSES
  135. ------------
  136. * EZD::            Base class for ezd graphic objects
  137.  
  138. DERIVED CLASSES
  139. ---------------
  140.  
  141. RELATED CLASSES
  142. ---------------
  143.  
  144. DESCRIPTION
  145. -----------
  146.  
  147. `EZDDiagWin' craetes a named window including a diagram. Actually there
  148. are three different styles (as an enum) implemeted in this class:
  149.    * DOT  : draws the diagram in form of dots
  150.  
  151.    * LINE : draws a line
  152.  
  153.    * HISTO: draws a histogram
  154. Constructors:
  155.  
  156. `EZDDiagWin();'
  157. `EZDDiagWin(CNParam *param);'
  158. `EZDDiagWin(int w, int h, Style s=LINE);'
  159. `EZDDiagWin(CNStringR n, int w, int h, Style s=LINE);'
  160. `EZDDiagWin(CNStringR n, CNStringR title, int w, int h, Style s=LINE);'
  161. `EZDDiagWin(CNStringR n, CNStringR title, int w, int h, int st, CNStringR cd, CNStringR cb, Style s=LINE);'
  162.      Initializes a named `EZDDiagwin'. `title' is the title of the
  163.      window, `w' and `h' the window's width and height. `st' is the
  164.      size of a step between two values (default: 1), `cd' is the color
  165.      of the diagram, `cb' the color of the bar (out-of-range display),
  166.      `s' the style of the diagram.
  167. In addition to the member functions required by CNCL, `CNEZDDiagWin'
  168. provides:
  169.  
  170. `void style(Style s);'
  171.      Changes the style to `s'.
  172.  
  173. `void add(int v);'
  174.      Adds a new value `v' at the current x-position to the diagram.
  175.  
  176. `void clear();'
  177.      Clears the diagram window.
  178.  
  179. `void set();'
  180.      Sets current drawing to diagram window drawing.
  181.  
  182. 
  183. File: cncl.info,  Node: EZDTextWin,  Next: EZDDiag,  Prev: EZDDiagWin,  Up: EZD Interface
  184.  
  185. EZDTextWin -- ezd window for easy text display
  186. ==============================================
  187.  
  188. SYNOPSIS
  189. --------
  190.  
  191.    `#include <CNCL/EZDTextWin.h>'
  192.  
  193. TYPE
  194. ----
  195.  
  196.    `CN_EZDTEXTWIN'
  197.  
  198. * Menu:
  199.  
  200. BASE CLASSES
  201. ------------
  202. * EZD::            Base Class for EZD Graphic Objects
  203.  
  204. DERIVED CLASSES
  205. ---------------
  206.  
  207. RELATED CLASSES
  208. ---------------
  209.  
  210. DESCRIPTION
  211. -----------
  212.  
  213. `EZDTextWin' provides an easy possibility for a text display in an EZD
  214. window.
  215. Constructors:
  216. `EZDTextWin(CNParam *param);'
  217. `EZDTextWin(int r=ROWS, int c=COLS, int ix=INCX, int iy=INCY);'
  218. `EZDTextWin(int r, int c, int ix, int iy, CNStringR f);'
  219. `EZDTextWin(CNStringR n, int r=ROWS, int c=COLS, int ix=INCX, int iy=INCY);'
  220. `EZDTextWin(CNStringR n, int r, int c, int ix, int iy, CNStringR f);'
  221. `EZDTextWin(CNStringR n, CNStringR t, int r=ROWS, int c=COLS, int ix=INCX, int iy=INCY);'
  222. `EZDTextWin(CNStringR n, CNStringR t, int r, int c, int ix, int iy, CNStringR f);'
  223.      Initializes `EZDTextWin'. `r' is the number of rows, `c' the
  224.      number of columns. `ix' and `iy' are the x-size of one column /
  225.      y-size of one row. Thus the total size of the window is (`c' *
  226.      `ix') by (`r' * `iy'). The strings are the window's name (`n'),
  227.      it's title (`t') and the font (`f'). No text is displayed in the
  228.      window yet.The constant default values are:
  229.      ROWS : 24, COLS : 80, INCX : 9, INCY : 15
  230. In addition to the member functions required by CNCL, `EZDTextWin'
  231. provides:
  232.  
  233. `int width() const;'
  234. `int height() const;'
  235.      Returns the window's width or height.
  236.  
  237. `int cols() const;'
  238. `int rows() const;'
  239.      Returns the number of rows or cols in the window.
  240.  
  241. `int incx() const;'
  242. `int incy() const;'
  243.      Returns the x-size of a column or the y-size of a row.
  244.  
  245. `int row_to_y(int r) const;'
  246. `int col_to_x(int c) const;'
  247.      Returns the y-/x-coordinate of the r-th row/ c-th column.
  248.  
  249. `void clear();'
  250.      Clears the whole text window, painting everything white.
  251.  
  252. `void clear(int r, int c, int l);'
  253.      Clears a window area. `r' is the row and `c' the column wich is
  254.      cleared, (`l' * `incx') the horizontal length in this area wich is
  255.      painted white.
  256.  
  257. `void set();'
  258.      Sets the current drawing to text window drawing.
  259.  
  260. `void hline(int r, int c, int l);'
  261. `void vline(int r, int c, int l);'
  262.      Draws a vertical/horizontal line of length `l', begining at the
  263.      position described by row `r' and col `c'.
  264.  
  265. `void add(int r, int c, CNStringR s);'
  266. `void add(int r, int c, CNStringR s, CNStringR f);'
  267.      Draws the text `s' in row `r', column `c'. Possible old text at
  268.      this position (length of string s) is wiped out. `f' is the font.
  269.  
  270. 
  271. File: cncl.info,  Node: EZDDiag,  Next: EZDBlock,  Prev: EZDTextWin,  Up: EZD Interface
  272.  
  273. EZDDiag -- x-y diagram as an EZDObject
  274. ======================================
  275.  
  276. SYNOPSIS
  277. --------
  278.  
  279.    `#include <CNCL/EZDDiag.h>'
  280.  
  281. TYPE
  282. ----
  283.  
  284.    `CN_EZDDIAG'
  285.  
  286. * Menu:
  287.  
  288. BASE CLASSES
  289. ------------
  290. * EZDObject::    Interface to ezd object
  291.  
  292. DERIVED CLASSES
  293. ---------------
  294.  
  295. RELATED CLASSES
  296. ---------------
  297. * EZDDiagWin::    Extra window with x-y diagram
  298.  
  299. DESCRIPTION
  300. -----------
  301.  
  302. `EZDDiag' creates a diagram as an ezd object.  Actually there are three
  303. different styles (as an enum) implemeted in this class:
  304.    * DOT  : draws the diagram in form of dots
  305.  
  306.    * LINE : draws a line
  307.  
  308.    * HISTO: draws a histogram
  309.  
  310.    Constructors:
  311.  
  312. `EZDDiag();'
  313. `EZDDiag(CNParam *param)'
  314. `EZDDiag(int w, int h, Style s=LINE);'
  315. `EZDDiag(int w, int h, int x, int y, Style s=LINE);'
  316. `EZDDiag(const CNString &name, int w, int h, int x, int y, Style s=LINE);'
  317. `EZDDiag(int w, int h, int x, int y, Style s, CNString cd, CNString cb);'
  318. `EZDDiag(const CNString &name, int w, int h, int x, int y, Style s, CNString cd, CNString cb);'
  319.      Initializes `EZDDiag' at the position `(x,y)', default (0,0), of
  320.      the current drawing as a named ezd object. `w' (default: 200) and
  321.      `h' (100) are the object`s width and heigth. `cd' ("black") and
  322.      `cb' ("red") are color-settings for the diagram and the bar which
  323.      is drawn if the value is out of the given range - e.g. negative
  324.      values or values > 100 at the default setting. The possible styles
  325.      `s' are described above. The object is drawn frameless, but a
  326.      frame can be added, see the functions below.
  327.  
  328.    In addition to the member functions required by CNCL, `EZDDiag'
  329. provides:
  330.  
  331. `void style(Style s);'
  332.      Sets the style of the diagram to `s'.
  333.  
  334. `void set_color_draw(CNString c);'
  335.      Sets the drawing color to `c'.
  336.  
  337. `void set_color_bar(CNString c);'
  338.      Sets the color of the bar (out-of-range display) to `c'.
  339.  
  340. `void add(int v);'
  341.      Adds the value `v' to the diagram.
  342.  
  343. `void clear();'
  344.      Clears the diagram.
  345.  
  346. `virtual void redraw();'
  347.      Redraws the diagram.
  348.  
  349. `void set_frame();'
  350.      Sets a frame to the diagram.
  351.  
  352. 
  353. File: cncl.info,  Node: EZDBlock,  Next: EZDPopUp,  Prev: EZDDiag,  Up: EZD Interface
  354.  
  355. EZDBlock -- Block with small rectangles for bit display
  356. =======================================================
  357.  
  358. SYNOPSIS
  359. --------
  360.  
  361.    `#include <CNCL/EZDBlock.h>'
  362.  
  363. TYPE
  364. ----
  365.  
  366.    `CN_EZDBLOCK'
  367.  
  368. * Menu:
  369.  
  370. BASE CLASSES
  371. ------------
  372. * EZDObject::    Interface to EZD Object
  373.  
  374. DERIVED CLASSES
  375. ---------------
  376.  
  377. RELATED CLASSES
  378. ---------------
  379.  
  380. DESCRIPTION
  381. -----------
  382.  
  383.    `EZDBlock' draws a block of several square rectangles. Each
  384. rectangle's side is `bsize' long, so that the total size of the block
  385. is determined by the number of rows and cols. Each rectangle's color is
  386. representing the state of a bit, `black' if the bit is turned on and
  387. `white' if turned off. The frame of all rectangles is 1 pixel by
  388. default.
  389. Constructors:
  390.  
  391. `EZDBlock();'
  392. `EZDBlock(CNParam *param);'
  393. `EZDBlock(const CNString &name, int x, int y, int r, int c, int b);'
  394.      Initializes the `EZDBlock' (does not draw it yet). `&name' is the
  395.      `EZDObjects' name, `(x,y)' its minimum coordinates (default
  396.      (0,0)). The block is made out of r by c square rectangles, each
  397.      side b long. At the initialzation all bits are assumed to be set
  398.      off (drawn white).
  399. In addition to the member functions required by CNCL, `EZDBlock'
  400. provides:
  401.  
  402. `virtual void redraw();'
  403.      Draws / redraws the whole block.
  404.  
  405. `void on(int b);'
  406. `void off(int b);'
  407.      Turns bit on(black)/off(white) and sets the color for it; redraws
  408.      the (whole) block.
  409.  
  410. 
  411. File: cncl.info,  Node: EZDPopUp,  Next: EZDQueue,  Prev: EZDBlock,  Up: EZD Interface
  412.  
  413. EZDPopUp -- Interface to EZD popup menu
  414. =======================================
  415.  
  416. SYNOPSIS
  417. --------
  418.  
  419.    `#include <CNCL/EZDPopUp.h>'
  420.  
  421. TYPE
  422. ----
  423.  
  424.    `CN_EZDPOPUP'
  425.  
  426. * Menu:
  427.  
  428. BASE CLASSES
  429. ------------
  430. * EZDObject::    Interface to EZD Object
  431.  
  432. DERIVED CLASSES
  433. ---------------
  434.  
  435. RELATED CLASSES
  436. ---------------
  437.  
  438. DESCRIPTION
  439. -----------
  440.  
  441. `EZDPopUp' is the interface to ezd's popup menus. It defines a named
  442. scheme that is called as the action on a button down event to display a
  443. popup menu. The scheme's functions, displayed names and all other
  444. parameters are stored in the struct `MENU'.  When button 1 is pressed
  445. down, the menu comes up. Releasing the button executes the action
  446. associated with the current menu entry. Moving the mouse outside the
  447. menu without releasing the button will cause the menu to disappear, no
  448. action is executed. For additional information see the ezd manual.
  449. Constructors:
  450.  
  451. `EZDPopUp();'
  452. `EZDPopUp(CNParam *param);'
  453. `EZDPopUp(const int nmenu, const MENU *menu ...);'
  454.      Initializes the conection to ezd's popup with a variable size of
  455.      parameters. `nmenu' is the total number of menu items, `MENU' a
  456.      struct descibed below.
  457. In addition to the member functions required by CNCL, `EZDPopUp'
  458. provides:
  459.  
  460. `typedef struct menue MENU;'
  461.      `MENU' is a struct of :
  462.     ``int posx, posy''
  463.           minimum (x,y) coordinates of the menu
  464.  
  465.     ``int height''
  466.           height of the menu
  467.  
  468.     ``CNString title''
  469.           menu title, used as name of the scheme
  470.  
  471.     ``CNString t_color''
  472.           title color
  473.  
  474.     ``CNString b_color, f_color''
  475.           color of the background and the frame
  476.  
  477.     ``CNString* inhalt''
  478.           menu entries
  479.  
  480.     ``CNString* scheme_func''
  481.           scheme functions
  482.  
  483.     ``int anz''
  484.           total number of menu entries
  485.  
  486.           Take note that the [i]th entrie and the [i]th function are
  487.           associated with each other. If `anz' is larger than the
  488.           correct number the program will terminate, if it is smaller,
  489.           all entries after that number are set inactive.
  490.  
  491. 
  492. File: cncl.info,  Node: EZDQueue,  Next: EZDServer,  Prev: EZDPopUp,  Up: EZD Interface
  493.  
  494. EZDQueue -- Graphical Representation of a Queue
  495. ===============================================
  496.  
  497. SYNOPSIS
  498. --------
  499.  
  500.    `#include <CNCL/EZDQueue.h>'
  501.  
  502. TYPE
  503. ----
  504.  
  505.    `CN_EZDQUEUE'
  506.  
  507. * Menu:
  508.  
  509. BASE CLASSES
  510. ------------
  511. * EZDObject::        Interface to EZD Objects
  512.  
  513. DERIVED CLASSES
  514. ---------------
  515.  
  516. RELATED CLASSES
  517. ---------------
  518. * EZDServer::        Graphical Representation of a Server
  519.  
  520. DESCRIPTION:
  521. ------------
  522.  
  523. `EZDQueue' is the graphical representation of a queue.  This drawing is
  524. handled as an `EZDObject', in which x is the most left and y the middle
  525. axis' coordinate. The bar, itself an `EZDObject', is representing the
  526. amount of tasks waiting inside the queue.
  527. Constructors:
  528.  
  529. `EZDQueue();'
  530. `EZDQueue(Param *param);'
  531. `EZDQueue(int x, int y, int width = WIDTH, int heigth = HEIGTH, int tail = TAIL);'
  532. `EZDQueue(const CNString &name, int x, int y, int width = WIDTH, int heigth = HEIGTH, int tail = TAIL);'
  533.      Initializes an `EZDQueue' as an `EZDObject' (default object name :
  534.      "queue" ) inside the current drawing at the coordinates `(x,y)' (
  535.      default value (0,0) ). Width ( 100 pixels ) and heigth ( 20 pixels
  536.      ) are the queue body's rectangle size measured in pixels, tail (
  537.      20 pixels ) the tail's length.
  538. In addition to the member functions required by CNCL, `EZDQueue'
  539. provides:
  540.  
  541. `int left() const;'
  542. `int rigth() const;'
  543. `int upper() const;'
  544. `int lower() const;'
  545.      Returns the left, right, upper or lower coordinate of the object
  546.      queue inside the current drawing.
  547.  
  548. `virtual void redraw();'
  549.      Redraws this queue in the current drawing.
  550.  
  551. `int length() const;'
  552. `int get_length() const;'
  553. `void length(int l);'
  554. `void set_length(int l);'
  555.      Get/set length of the queue-bar.
  556.  
  557. `void color(const CNString &c);'
  558.      Sets the color of the queue-bar to `c' and redraws the queue.
  559.  
  560. 
  561. File: cncl.info,  Node: EZDServer,  Next: EZDText,  Prev: EZDQueue,  Up: EZD Interface
  562.  
  563. EZDServer -- Graphical Representation of a Server
  564. =================================================
  565.  
  566. SYNOPSIS
  567. --------
  568.  
  569.    `#include <CNCL/EZDServer.h>'
  570.  
  571. TYPE
  572. ----
  573.  
  574.    `CN_EZDSERVER'
  575.  
  576. * Menu:
  577.  
  578. BASE CLASSES
  579. ------------
  580. * EZDObject::        Interface to EZD Objects
  581.  
  582. DERIVED CLASSES
  583. ---------------
  584.  
  585. RELATED CLASSES
  586. ---------------
  587. * EZDQueue::        Graphical Representation of a Queue
  588.  
  589. DESCRIPTION:
  590. ------------
  591.  
  592. `EZDServer' is the graphical representation of a server.  This drawing
  593. is handled as an `EZDObject', in which x is the most left and y the
  594. middle axis' coordinate.
  595. Constructors:
  596.  
  597. `EZDServer();'
  598. `EZDServer(CNParan *param);'
  599. `EZDServer(int x, int y , int radius = RADIUS);'
  600. `EZDServer(const CNString &name, int x, int y, int radius=RADIUS);'
  601.      Initializes an `EZDServer' as an `EZDObject' (default object name
  602.      : "server" ) inside the current drawing at the coordinates `(x,y)'
  603.      ( default value (0,0) ) with `radius' ( default 20 pixels ).
  604.  
  605.    In addition to the member functions required by CNCL, `EZDServer'
  606. provides:
  607.  
  608. `virtual void redraw();'
  609.      Redraws the server in the current drawing.
  610.  
  611. `void color(const CNString &c);'
  612.      Sets the color of the server to `c' and redraws the server in the
  613.      current drawing.
  614.  
  615. 
  616. File: cncl.info,  Node: EZDText,  Next: EZDTimer,  Prev: EZDServer,  Up: EZD Interface
  617.  
  618. EZDText -- EZD Object with Text
  619. ===============================
  620.  
  621. SYNOPSIS
  622. --------
  623.  
  624.    `#include <CNCL/EZDText.h>'
  625.  
  626. TYPE
  627. ----
  628.  
  629.    `CN_EZDTEXT'
  630.  
  631. * Menu:
  632.  
  633. BASE CLASSES
  634. ------------
  635. * EZDObject::        Interface to EZD Objects
  636.  
  637. DERIVED CLASSES
  638. ---------------
  639.  
  640. RELATED CLASSES
  641. ---------------
  642.  
  643. DESCRIPTION:
  644. ------------
  645.  
  646. `EZDText' writes text into a clear rectangle. The rectangle is handled
  647. as an `EZDObject', its size is automatically as large as necessary to
  648. hold the text in the given `font' and `(x,y)' are its minimum
  649. coordinates in the current drawing. Note that the `font' name is
  650. specified as a string in X font name terminology.
  651. Constructors:
  652.  
  653. `EZDText();'
  654. `EZDText(CNParam *param);'
  655. `EZDText(int x, int y, const CNString &text);'
  656. `EZDText(const CNString &name, int x, int y, const CNString &text);'
  657. `EZDText(int x, int y, const CNString &text, const CNString &font);'
  658. `EZDText(const CNString &name, int x, int y, const CNString &text, const CNString &font);'
  659.      Initializes the `EZDObject' and displays the `text' in the current
  660.      drawing at the `(x,y)' coordinates. If no `EZDObject' name is
  661.      chosen it is called "text".
  662. In addition to the member functions required by CNCL, `EZDText'
  663. provides:
  664.  
  665. `virtual void redraw();'
  666.      Redraws the `text' in the current drawing.
  667.  
  668. `void set_text(const CNString &t);'
  669. `void set_text_val(int x);'
  670. `void set_text_val(const CNString &t, int x);'
  671. `void set_text_val(double x);'
  672. `void set_text_val(const CNString &t, double x);'
  673.      Creates `text' out of text, integer or double and displays it in
  674.      the current drawing.
  675.  
  676. 
  677. File: cncl.info,  Node: EZDTimer,  Next: CNFClause,  Prev: EZDText,  Up: EZD Interface
  678.  
  679. EZDTimer -- Graphical Representation of a Timer
  680. ===============================================
  681.  
  682. SYNOPSIS
  683. --------
  684.  
  685.    `#include <CNCL/EZDTimer.h>'
  686.  
  687. TYPE
  688. ----
  689.  
  690.    `CN_EZDTIMER'
  691.  
  692. * Menu:
  693.  
  694. BASE CLASSES
  695. ------------
  696. * EZDObject::        Interface to ezd objects
  697.  
  698. DERIVED CLASSES
  699. ---------------
  700.  
  701. RELATED CLASSES
  702. ---------------
  703.  
  704. DESCRIPTION
  705. -----------
  706.  
  707. `EZDTimer' draws an `EZDObject' representing a timer. It is realized as
  708. a filled pie arc inside of an oval. The `(x,y)' coordinates are the
  709. center coordinates of the object in the current drawing. The timer
  710. starts (by default) at 270 degrees (12 o'clock position) as an offset
  711. value. The pie dimension angle (in degrees) is the pie's size.  The
  712. default colors are black on white backround.  Please note that the
  713. timer doesn't count automatically, each change of the shown value has
  714. to be programmed.
  715. Constructors:
  716.  
  717. `EZDTimer();'
  718. `EZDTimer(CNParam *param);'
  719. `EZDTimer(int x, int y, int radiusx=RADIUSX, int radiusy=RADIUSY);'
  720. `EZDTimer(const CNString &name, int x, int y, int radiusx=RADIUSX, int radiusy=RADIUSY);'
  721.      Initializes the timer as an `EZDObject'. The default object's name
  722.      is "Timer". Radiusx and radiusy are the oval's radius in (x,y)
  723.      direction, measured in pixels (default:(5,5))
  724. In addition to the member functions required by CNCL, `EZDTimer'
  725. provides:
  726.  
  727. `int left();'
  728. `int right();'
  729. `int upper();'
  730. `int lower();'
  731.      Returns the oval's most left/right/upper/lower layout coordinates
  732.      in pixels.
  733.  
  734. `virtual void redraw();'
  735.      Redraws the timer in the current drawing.
  736.  
  737. `int offset_angle()'
  738. `int get_offset_angle()'
  739.      Returns the timer's current offset angle.
  740.  
  741. `void offset_angle(int a);'
  742. `void set_offset_angle(int a);'
  743.      Sets the timer's offset angle to `a' degrees and redraws the pie.
  744.  
  745. `int angle();'
  746. `int get_angle();'
  747.      Returns the timer's pie dimension angle.
  748.  
  749. `void angle(int a);'
  750. `void set_angle(int a);'
  751.      Sets the timer's pie dimension angle to `a' degrees and redraws
  752.      the pie.
  753.  
  754. `void color(const CNString &c);'
  755.      Sets the timer's color to `c' and redraws the timer.
  756.  
  757. `void activate();'
  758. `void deactivate();'
  759.      Activates/deactivates an additional oval in 4 pixels distance to
  760.      the timer.
  761.  
  762. `void active_color(const CNString &c);'
  763.      Sets the additional oval's color to `c' but does not redraw it.
  764.  
  765. 
  766. File: cncl.info,  Node: Fuzzy,  Next: Persistent,  Prev: EZD Interface,  Up: Top
  767.  
  768. Fuzzy classes
  769. *************
  770.  
  771.    CNCL provides a set of classes for building fuzzy inference engines.
  772. Available are fuzzy sets, fuzzy variables, and a inference engine based
  773. on fuzzy rules. The membership values are normalized ( by default ), but
  774. can be changed  to max and min values in different classes. All fuzzy
  775. sets and functions are realized with crisply defined membership values (
  776. type 1 fuzzy sets and functions ).
  777. Currently prod-min inference is used and a center-of-gravity output
  778. defuzzification. This will be extended in a future release, providing
  779. different operators for aggregation, inference, and accumulation. Up to
  780. now two different fuzzy set representations are implemented:
  781. LR-representation and arrays.
  782.  
  783. For more information about fuzzy logic see:
  784. Zimmermann,. H.-J. [1991]. Fuzzy Set Theory And Its Applications.
  785. Kluwer Accademic Publishers.
  786. Additionally, the FAQ of the newsgroup "comp.ai.fuzzy" should be
  787. recommended in this context.
  788.  
  789. * Menu:
  790.  
  791. Fuzzy
  792. -----
  793. * CNFClause::        Clause of a fuzzy rule
  794. * CNFVar::        Fuzzy variable
  795. * CNFRule::        Fuzzy rule
  796. * CNFRuleBase::        Rule base and Fuzzy inference engine
  797. * CNFSet::        Fuzzy set abstract base class
  798. * CNFSetArray::        Fuzzy set based on array with membership values
  799. * CNFSetLR::        Fuzzy set with L and R functions
  800. * CNFSetTrapez::    Fuzzy set with trapezium function
  801. * CNFSetTriangle::    Fuzzy set with triangle function
  802. * CNFNumTriangle::      Fuzzy numbers (triangle)
  803.  
  804. 
  805. File: cncl.info,  Node: CNFClause,  Next: CNFVar,  Prev: EZDTimer,  Up: Fuzzy
  806.  
  807. CNFClause -- Clause of a fuzzy rule
  808. ===================================
  809.  
  810. SYNOPSIS
  811. --------
  812.  
  813.    `#include <CNCL/FClause.h>'
  814.  
  815. TYPE
  816. ----
  817.  
  818.    `CN_FCLAUSE'
  819.  
  820. * Menu:
  821.  
  822. BASE CLASSES
  823. ------------
  824. * CNObject::        Root of the CNCL hierarchy
  825.  
  826. DERIVED CLASSES
  827. ---------------
  828.  
  829. RELATED CLASSES
  830. ---------------
  831.  
  832. DESCRIPTION
  833. -----------
  834.  
  835.    A `CNFClause' is basically a structure containing a fuzzy variable /
  836. fuzzy value pair. The members
  837.      CNFVar *var;            // Linguistic variable
  838.      CNFSet *value;            // Linguistic value
  839.    are public accessible.
  840.  
  841.    Constructors:
  842.  
  843. `CNFClause();'
  844. `CNFClause(CNParam *param);'
  845. `CNFClause(CNFVar *xvar, CNFSet *xset);'
  846. `CNFClause(CNFVar &xvar, CNFSet &xset);'
  847.      Initializes a `CNFVar' and a `CNFSet' to a `CNFClause'.
  848.  
  849.    In addition to the member functions required by CNCL, `CNFClause'
  850. provides:
  851.  
  852. `void print_clause(ostream &strm, bool lhs) const;'
  853.      Prints the public accessible variables on the output stream
  854.      `&strm'.
  855.  
  856. 
  857. File: cncl.info,  Node: CNFVar,  Next: CNFRule,  Prev: CNFClause,  Up: Fuzzy
  858.  
  859. CNFVar -- Fuzzy variable
  860. ========================
  861.  
  862. SYNOPSIS
  863. --------
  864.  
  865.    `#include <CNCL/FVar.h>'
  866.  
  867. TYPE
  868. ----
  869.  
  870.    `CN_FVAR'
  871.  
  872. * Menu:
  873.  
  874. BASE CLASSES
  875. ------------
  876. * CNNamed::        CNObject with name
  877.  
  878. DERIVED CLASSES
  879. ---------------
  880.  
  881. RELATED CLASSES
  882. ---------------
  883.  
  884. DESCRIPTION
  885. -----------
  886.  
  887.    This class creates a fuzzy variable and its corrosponding linguistic
  888. variable. For example, the linguistic variable "temperature" migth be
  889. programmed this way:
  890. CNFVar temp("Temperature", 0, 100);
  891. enum { COLD, MEDIUM, WARM, HOT };
  892. temp.add_value_set(COLD,   new CNFSetTrapez("cold",    0, 10,  0, 10));
  893. temp.add_value_set(MEDIUM, new CNFSetTrapez("medium", 20, 20, 10, 10));
  894. temp.add_value_set(WARM,   new CNFSetTrapez("warm",   30, 40, 10,  5));
  895. temp.add_value_set(HOT,  new CNFSetTrapez("hot",  40,100, 10,  0));
  896. Here trapezium functions have been assumed as membership function, but
  897. all other kinds of (implemented) functions are possible.
  898.  
  899.    Constructors:
  900.  
  901. `CNFVar(CNParam *param);'
  902. `CNFVar(double min = 0, double max = 1);'
  903. `CNFVar(const CNString &xname, double min = 0, double max = 1);'
  904.      Initializes the `CNFVar'.
  905. In addition to the member functions required by CNCL, `CNFVar' provides:
  906.  
  907. `double value( double x );'
  908. `double set_value( double x );'
  909.      Sets the (non fuzzy) variable value to `x' and returns the old
  910.      value.
  911.  
  912. `double value() const'
  913. `double get_value()const;'
  914.      Returns the (non-fuzzy) value.
  915.  
  916. `CNFSet* fuzzy_value( CNFSet* x );'
  917. `CNFSet* set_fuzzy_value( CNFSet* x );'
  918.      Sets the fuzzy variable value (fuzzy set) to `x' and returns the
  919.      old value.
  920.  
  921. `CNFSet* fuzzy_value() const;'
  922. `CNFSet* get_fuzzy_value() const;'
  923.      Returns the fuzzy value (fuzzy set).
  924.  
  925. `double xmin() const;'
  926. `double get_xmin() const;'
  927. `double xmax() const;'
  928. `double get_xmax() const;'
  929.      Returns the minimum and maximum values of the variable's range.
  930.  
  931. `void add_value_set(CNFSet &fset);'
  932. `void add_value_set(CNFSet *fset);'
  933. `void add_value_set(int i, CNFSet &fset);'
  934. `void add_value_set(int i, CNFSet *fset);'
  935.      Adds the fuzzy set `fset' to the array of affiliated sets, either
  936.      at position `i' (overwritting) or at the end (extending).
  937.  
  938. `CNFSet *get_value_set(int i);'
  939.      Returns the fuzzy set at array position `i'.
  940.  
  941. `double get_membership( int i);'
  942.      Gets the membership value of the fuzzy set at array position `i'.
  943.  
  944. `void print_membership();'
  945.      Computes the membership value for all fuzzy sets using the current
  946.      value and prints the result.
  947.  
  948. 
  949. File: cncl.info,  Node: CNFRule,  Next: CNFRuleBase,  Prev: CNFVar,  Up: Fuzzy
  950.  
  951. CNFRule -- Fuzzy Rule
  952. =====================
  953.  
  954. SYNOPSIS
  955. --------
  956.  
  957.    `#include <CNCL/FRule.h>'
  958.  
  959. TYPE
  960. ----
  961.  
  962.    `CN_FRULE'
  963.  
  964. * Menu:
  965.  
  966. BASE CLASSES
  967. ------------
  968. * CNObject::        Root of the CNCL hierarchy
  969.  
  970. DERIVED CLASSES
  971. ---------------
  972.  
  973. RELATED CLASSES
  974. ---------------
  975.  
  976. DESCRIPTION
  977. -----------
  978.  
  979.    Constructors:
  980.  
  981. `CNFRule();'
  982. `CNFRule(CNParam *param);'
  983.      Initializes a `CNFRule' variable.
  984. In addition to the member functions required by CNCL, `CNFRule'
  985. provides:
  986.  
  987. `void add_lhs(CNFClause *clause);'
  988. `void add_lhs(CNFClause &clause);'
  989. `void add_rhs(CNFClause *clause);'
  990. `void add_rhs(CNFClause &clause);'
  991.      Adds a `CNFClause' to the LHS or the RHS rules.
  992.  
  993. `int get_n_lhs() const;'
  994. `int get_n_rhs() const;'
  995.      Gets the total number of LHS/RHS clauses.
  996.  
  997. `CNFClause* get_lhs(int i) const;'
  998. `CNFClause* get_rhs(int i) const;'
  999.      Returns the LHS/RHS clause from array-position `i'.
  1000.  
  1001. `double certainty(double x);'
  1002. `double set_certainty(double x);'
  1003.      Sets the certainty to `x' and returns the old certainty.
  1004.  
  1005. `double certainty() const;'
  1006. `double get_certainty() const;'
  1007.      Returns the certainty.
  1008.  
  1009. `double aggregate_value() const;'
  1010.      Returns the current value of the aggregation.
  1011.  
  1012. `double aggregate()'
  1013.      Aggregates the LHS rule inputs and returns the result.
  1014.  
  1015. 
  1016. File: cncl.info,  Node: CNFRuleBase,  Next: CNFSet,  Prev: CNFRule,  Up: Fuzzy
  1017.  
  1018. CNFRuleBase -- Rule base and Fuzzy inference engine
  1019. ===================================================
  1020.  
  1021. SYNOPSIS
  1022. --------
  1023.  
  1024.    `#include <CNCL/FRuleBase.h>'
  1025.  
  1026. TYPE
  1027. ----
  1028.  
  1029.    `CN_FRULEBASE'
  1030.  
  1031. * Menu:
  1032.  
  1033. BASE CLASSES
  1034. ------------
  1035. * CNNamed::        CNObject with name
  1036.  
  1037. DERIVED CLASSES
  1038. ---------------
  1039.  
  1040. RELATED CLASSES
  1041. ---------------
  1042.  
  1043. DESCRIPTION
  1044. -----------
  1045.  
  1046.    Constructors:
  1047.  
  1048. `CNFRuleBase();'
  1049. `CNFRuleBase(CNParam *param);'
  1050. `CNFRuleBase(CNStringR name);'
  1051.      Initializes the `CNFRuleBase' with `name' as the object's name.
  1052. In addition to the member functions required by CNCL, `CNFRuleBase'
  1053. provides:
  1054.  
  1055. `void add_rule(CNFRule *rule);'
  1056. `void add_rule(CNFRule &rule);'
  1057.      Adds rule to base.
  1058.  
  1059. `void add_in_var(CNFVar *rule);'
  1060. `void add_in_var(CNFVar &rule);'
  1061. `void add_out_var(CNFVar *rule);'
  1062. `void add_out_var(CNFVar &rule);'
  1063.      Adds input/output variables to the base.
  1064.  
  1065. `int get_n_rules()const;'
  1066. `int get_n_in_vars()const;'
  1067. `int get_n_out_vars()const;'
  1068.      Returns the number of rules/input variables/output variables in
  1069.      this base.
  1070.  
  1071. `int resolution()const;'
  1072.      Returns the output fuzzy set resolution.
  1073.  
  1074. `void inference(CNFVar *var, CNFSet *set , double match, CNFSetArray &res);'
  1075.      Computes the inference set for variable `var' and value `set',
  1076.      using value `match' of LHS aggregation. The result is stored in the
  1077.      array fuzzy set `res'.
  1078.  
  1079. `void evaluate(CNFVar *var, CNFSetArray &res);'
  1080.      Computes output set for variable `var', combining the
  1081.      `inference()' results of all rules. The result is stored in the
  1082.      array fuzzy set `res'.
  1083.  
  1084. `void aggregate_all();'
  1085.      Aggregates all rules.
  1086.  
  1087. `void evaluate_all();'
  1088.      Evaluates all variables.
  1089.  
  1090. `void defuzzy_all();'
  1091.      Defuzzifies all output variables.
  1092.  
  1093. `void debug_rules(ostream &strm=cout, int lvl=0);'
  1094.      Debugs the output on `&strm' for fuzzy rules.
  1095.  
  1096. 
  1097. File: cncl.info,  Node: CNFSet,  Next: CNFSetArray,  Prev: CNFRuleBase,  Up: Fuzzy
  1098.  
  1099. CNFSet -- Fuzzy set abstract base class
  1100. =======================================
  1101.  
  1102. SYNOPSIS
  1103. --------
  1104.  
  1105.    `#include <CNCL/FSet.h>'
  1106.  
  1107. TYPE
  1108. ----
  1109.  
  1110.    `CN_FSET'
  1111.  
  1112. * Menu:
  1113.  
  1114. BASE CLASSES
  1115. ------------
  1116. * CNNamed::        CNObject with name
  1117.  
  1118. DERIVED CLASSES
  1119. ---------------
  1120. * CNFSetArray::        Fuzzy set based on array with membership values
  1121. * CNFSetLR::        Fuzzy set with L and R function
  1122.  
  1123. RELATED CLASSES
  1124. ---------------
  1125.  
  1126. DESCRIPTION
  1127. -----------
  1128.  
  1129.    `CNFSet' is the abstract base class for fuzzy set realizations.
  1130.  
  1131.    Constructors:
  1132.  
  1133. `CNFSet(CNParam *param);'
  1134. `CNFSet(double min = 0, double max = 1);'
  1135. `CNFSet(const CNStringR xname, double min = FSET_MIN, double max = FSET_MAX);'
  1136.      Initializes a `CNFSet' with `xname' as the object's name.  `min'
  1137.      and `max' determine the range of the membership values. `FSET_MIN'
  1138.      equals 0.0, `FSET_MAX' equals 1.0.
  1139. In addition to the member functions required by CNCL, `CNFSet' provides:
  1140.  
  1141. `virtual double get_membership(double x) const = 0;'
  1142.      Gets the membership values for `x'.
  1143.  
  1144. `virtual double center_of_gravity(double min, double max) const;'
  1145.      Computes the center of gravity for the defuzzyfication. (not
  1146.      implemented yet)
  1147.  
  1148. 
  1149. File: cncl.info,  Node: CNFSetArray,  Next: CNFSetLR,  Prev: CNFSet,  Up: Fuzzy
  1150.  
  1151. CNFSetArray -- Fuzzy set based on array with membership values
  1152. ==============================================================
  1153.  
  1154. SYNOPSIS
  1155. --------
  1156.  
  1157.    `#include <CNCL/FSetArray.h>'
  1158.  
  1159. TYPE
  1160. ----
  1161.  
  1162.    `CN_FSETARRAY'
  1163.  
  1164. * Menu:
  1165.  
  1166. BASE CLASSES
  1167. ------------
  1168. * CNFSet::        Fuzzy set abstract base class
  1169.  
  1170. DERIVED CLASSES
  1171. ---------------
  1172.  
  1173. RELATED CLASSES
  1174. ---------------
  1175.  
  1176. DESCRIPTION
  1177. -----------
  1178.  
  1179.    This class realizes a fuzzy set as an array. The array is containing
  1180. the membership values and the index is its corrosponding x-value. Thus
  1181. membership values of non-integers are interpolated.
  1182.  
  1183.    Constructors:
  1184.  
  1185. `CNFSetArray();'
  1186. `CNFSetArray(CNParam *param);'
  1187. `CNFSetArray(size_t sz, double min, double max);'
  1188.      Initializes `CNFSetArray'.
  1189. In addition to the member functions required by CNCL, `CNFSetArray'
  1190. provides:
  1191.  
  1192. `virtual double get_membership(double x)const;'
  1193.      Gets membership value for `x'.
  1194.  
  1195. `virtual double center_of_gravity(double min, double max)const;'
  1196.      Computes the center of gravity.
  1197.  
  1198. `double  get(int i) const;'
  1199.      Gets the value from the array.
  1200.  
  1201. `void put(int i, double x);'
  1202.      Puts value `x' into array at position `i'.
  1203.  
  1204. `double &operator [] (int i);'
  1205.      Provides the direct access to the internal array.
  1206.  
  1207. `int get_n() const;'
  1208.      Returns the size of the array.
  1209.  
  1210. 
  1211. File: cncl.info,  Node: CNFSetLR,  Next: CNFSetTrapez,  Prev: CNFSetArray,  Up: Fuzzy
  1212.  
  1213. CNFSetLR -- Fuzzy set with L and R functions
  1214. ============================================
  1215.  
  1216. SYNOPSIS
  1217. --------
  1218.  
  1219.    `#include <CNCL/FSetLR.h>'
  1220.  
  1221. TYPE
  1222. ----
  1223.  
  1224.    `CN_FSETLR'
  1225.  
  1226. * Menu:
  1227.  
  1228. BASE CLASSES
  1229. ------------
  1230. * CNFSet::        Fuzzy set abstract base class
  1231.  
  1232. DERIVED CLASSES
  1233. ---------------
  1234. * CNFSetTrapez::    Fuzzy set with trapezium function
  1235.  
  1236. RELATED CLASSES
  1237. ---------------
  1238.  
  1239. DESCRIPTION
  1240. -----------
  1241.  
  1242.    `CNFSetLR' provides the LR-representation of fuzzy sets. At this
  1243. representation, the interval [xm1, xm2] is considered to have the
  1244. maximum membership value ( 1 if normalized ), the left (L) and right (R)
  1245. approach is described by a shape function. Additionally, a left (alpha)
  1246. and a right (beta) slope is defined, thus the whole membership function
  1247. is:
  1248. L ( (xm1 - x) / alpha )  for x <= xm1
  1249. max (1 if normalized)    for xm1 <= x <= xm2
  1250. R ( (x - xm2) / beta )   for x >= xm2
  1251.  
  1252.    Constructors:
  1253.  
  1254. `CNFSetLR();'
  1255. `CNFSetLR(CNParam *param);'
  1256. `CNFSetLR(double xm1, double xm2, double xalpha, double xbeta, CNFuncType fL, CNFuncType fR);'
  1257. `CNFSetLR(double min, double max, double xm1, double xm2, double xalpha, double xbeta, CNFuncType fL, CNFuncType fR);'
  1258. `CNFSetLR(CNStringR xname, double min, double max, double xm1, double xm2 double xalpha, double xbeta, CNFuncType fL, CNFuncType fR);'
  1259. `CNFSetLR(CNStringR xname, double xm1, double xm2, double xalpha, double xbeta, CNFuncType fL, CNFuncType fR);'
  1260.      Initializes `CNFSetLR'. The possible variables and their default
  1261.      values are:
  1262.      left/right maximum `(xm1,xm2)' (0,0), the left/right slope
  1263.      `(alpha,beta)' (0,0), the left/right function `(fL,fR)'
  1264.      (CNFuncLin,CNFuncLin) and the values for the named `CNFSet'
  1265.      `xname,min,max' with the according default settings of that class.
  1266.  
  1267. In addition to the member functions required by CNCL, `CNFSetLR'
  1268. provides:
  1269.  
  1270. `typedef double (*CNFuncType)(double x);'
  1271.      Function pointer to the functions for L/R use. Implemented
  1272.      functions are:
  1273.         * double CNFuncExp (double x);
  1274.           exp(-x)
  1275.  
  1276.         * double CNFuncExp2(double x);
  1277.           exp(-x^2)
  1278.  
  1279.         * double CNFuncLin (double x);
  1280.           1-x
  1281.  
  1282.         * double CNFuncSqr (double x);
  1283.           1-x^2
  1284.  
  1285.         * double CNFuncHyp (double x);
  1286.           1/(1+x)
  1287.  
  1288.         * double CNFuncHyp2(double x);
  1289.           1/(1+x^2)
  1290.  
  1291. `virtual double get_membership(double x) const;'
  1292.      Gets the membership values for `x'.
  1293.  
  1294. `double get_m1() const;'
  1295.      Returns the value `m1' (left maximum).
  1296.  
  1297. `double get_m2() const;'
  1298.      Returns the value `m2' (right maximum).
  1299.  
  1300. `double get_alpha() const;'
  1301.      Returns the value `alpha' (left slope).
  1302.  
  1303. `double get_beta() const;'
  1304.      Returns the value `beta' (right slope).
  1305.  
  1306. 
  1307. File: cncl.info,  Node: CNFSetTrapez,  Next: CNFSetTriangle,  Prev: CNFSetLR,  Up: Fuzzy
  1308.  
  1309. CNFSetTrapez -- Fuzzy set with trapezium function
  1310. =================================================
  1311.  
  1312. SYNOPSIS
  1313. --------
  1314.  
  1315.    `#include <CNCL/FSetTrapez.h>'
  1316.  
  1317. TYPE
  1318. ----
  1319.  
  1320.    `CN_FSETTRAPEZ'
  1321.  
  1322. * Menu:
  1323.  
  1324. BASE CLASSES
  1325. ------------
  1326. * CNFSetLR::        Fuzzy set with L and R functions
  1327.  
  1328. DERIVED CLASSES
  1329. ---------------
  1330. * CNFSetTriangle::    Fuzzy set with triangle function
  1331.  
  1332. RELATED CLASSES
  1333. ---------------
  1334.  
  1335. DESCRIPTION
  1336. -----------
  1337.  
  1338.    `CNFSetTrapez' realizes a trapezium shaped membership function on
  1339. the base of an LR fuzzy set.
  1340.  
  1341.    Constructors:
  1342.  
  1343. `CNFSetTrapez()'
  1344. `CNFSetTrapez(CNParam *param);'
  1345. `CNFSetTrapez(double xm1, double xm2, double xalpha, double xbeta);'
  1346. `CNFSetTrapez(double min, double max, double xm1, double xm2, double xalpha, double xbeta);'
  1347. `CNFSetTrapez(CNStringR xname, double xm1, double xm2, double xalpha, double xbeta);'
  1348. `CNFSetTrapez(CNStringR xname, double min, double max, double xm1, double xm2, double xalpha, double xbeta);'
  1349.      Initialize `CNFSetTrapez' with `name' as the object's name.  `xm1'
  1350.      is the x-value of the left maximum, `xm2' of the right one.
  1351.      `xalpha' is the left and `xbeta' the right slope. `min' and `max'
  1352.      are the function's minimum / maximum.
  1353. In addition to the member functions required by CNCL, `CNFSetTrapez'
  1354. provides:
  1355.  
  1356. `virtual double get_membership(double x) const;'
  1357.      Returns the membership value for `x'.
  1358.  
  1359. 
  1360. File: cncl.info,  Node: CNFSetTriangle,  Next: CNFNumTriangle,  Prev: CNFSetTrapez,  Up: Fuzzy
  1361.  
  1362. CNFSetTriangle -- Fuzzy set with triangle function
  1363. ==================================================
  1364.  
  1365. SYNOPSIS
  1366. --------
  1367.  
  1368.    `#include <CNCL/FSetTriangle.h>'
  1369.  
  1370. TYPE
  1371. ----
  1372.  
  1373.    `CN_FSETTRIANGLE'
  1374.  
  1375. * Menu:
  1376.  
  1377. BASE CLASSES
  1378. ------------
  1379. * CNFSetTrapez::    Fuzzy set with trapezium functions
  1380.  
  1381. DERIVED CLASSES
  1382. ---------------
  1383. * CNFNumTriangle::      Fuzzy number (triangle)
  1384.  
  1385. RELATED CLASSES
  1386. ---------------
  1387.  
  1388. DESCRIPTION
  1389. -----------
  1390.  
  1391.    `CNFSetTriangle' realizes a triangle shaped membership function.
  1392.  
  1393.    Constructors:
  1394.  
  1395. `CNFSetTriangle();'
  1396. `CNFSetTriangle(CNParam *param);'
  1397. `CNFSetTriangle(double xm, double xalpha, double xbeta);'
  1398. `CNFSetTriangle(double min, double max, double xm, double xalpha, double xbeta);'
  1399. `CNFSetTriangle(CNStringR xname, double xm, double xalpha, double xbeta);'
  1400. `CNFSetTriangle(CNStringR xname, double min, double max,double xm, double xalpha, double xbeta);'
  1401.      Initializes the `CNFSetTriangle'.
  1402. In addition to the member functions required by CNCL, `CNFSetTriangle'
  1403. provides:
  1404.  
  1405. `virtual double get_membership(double x)const;'
  1406.      Returns the membership value for `x'.
  1407.  
  1408. `double get_mean() const;'
  1409.      Returns the mean value `m1==m2' (maximum).
  1410.  
  1411. 
  1412. File: cncl.info,  Node: CNFNumTriangle,  Next: CNReaderTbl,  Prev: CNFSetTriangle,  Up: Fuzzy
  1413.  
  1414. CNFNumTriangle -- Fuzzy number (triangle)
  1415. =========================================
  1416.  
  1417. SYNOPSIS
  1418. --------
  1419.  
  1420.    `#include <CNCL/FNumTriangle.h>'
  1421.  
  1422. TYPE
  1423. ----
  1424.  
  1425.    `CN_FNUMTRIANGLE'
  1426.  
  1427. * Menu:
  1428.  
  1429. BASE CLASSES
  1430. ------------
  1431. * CNFSetTriangle::    Fuzzy set with triangle functions
  1432.  
  1433. DERIVED CLASSES
  1434. ---------------
  1435.  
  1436. RELATED CLASSES
  1437. ---------------
  1438.  
  1439. DESCRIPTION
  1440. -----------
  1441.  
  1442.    `CNFNumTriangle' provides triangle fuzzy set the necessarry
  1443. mathematical operations and methods for defuzzification.
  1444.  
  1445.    Constructors:
  1446.  
  1447. `CNFNumTriangle();'
  1448. `CNFNumTriangle(CNParam *param);'
  1449. `CNFNumTriangle(double m, double a, double b);'
  1450. `CNFNumTriangle(const CNFSetTriangle &n);'
  1451.      Initializes `CNFNumTriangle'.
  1452. In addition to the member functions required by CNCL, `CNFNumTriangle'
  1453. provides:
  1454.  
  1455. `double center_of_gravity(double min, double max)const;'
  1456.      Returns the center of gravity.
  1457.  
  1458. `double defuzzy();'
  1459.      Returns the defuzzyfied variable.
  1460.  
  1461. `CNFNumTriangle sqr(CNFNumTriangle);'
  1462.      Squares a `CNFNumTriangle' set, using the extension principle.
  1463.  
  1464. `CNFNumTriangle abs(CNFNumTriangle);'
  1465.      Returns the positiv `CNFNumTriangle'.
  1466.  
  1467. `CNFNumTriangle &operator =(const CNFNumTriangle &n);'
  1468.      Sets this `CNFNumTriangle' to `n'.
  1469.  
  1470. `CNFNumTriangle operator +(CNFNumTriangle, CNFNumTriangle);'
  1471. `CNFNumTriangle operator -(CNFNumTriangle, CNFNumTriangle);'
  1472. `CNFNumTriangle operator *(CNFNumTriangle, double);'
  1473. `CNFNumTriangle operator *(double, CNFNumTriangle);'
  1474.      Adds/ substracts two `CNFNumTriangle' sets or multiplies one with a
  1475.      double (extension principle).
  1476.  
  1477. 
  1478. File: cncl.info,  Node: Persistent,  Prev: Fuzzy,  Up: Top
  1479.  
  1480. Persistent Classes
  1481. ******************
  1482.  
  1483.    The classes described here provide the possibility of persistent
  1484. objects. As in most cases it is not necessary to have all the overhead
  1485. for persistency inside of a running program, no complete new class need
  1486. to be designed if persistency is needed. It is sufficient to add an
  1487. extension to a CNCL-kompatible class where all necessary methods are
  1488. included.
  1489.  
  1490.    To generate new persistent classes or extensions, derived from any
  1491. `CNCL' compatible class, the utility `CNpersistent' is provided. It
  1492. generates a class framework with all functions required by CNCL and all
  1493. necesarry methods for persistency.
  1494.  
  1495.    Usage:
  1496.  
  1497.      `CNpersistent'[-l] [-t template-dir] basename
  1498.  
  1499.    The required parameter `basename' is the name of the base class.
  1500. This sript will produce the persistent extension to the mentioned base
  1501. class.  The result are two files in the current directory:
  1502. `P'basename`.h' (header file) and `P'basename`.c' (implementation file).
  1503.  
  1504.    The optional parameters are:
  1505.    * [-l] : The base class is stored in the local directory, not in the
  1506.      standard CNCL-tree.
  1507.  
  1508.    * [-t template-dir] : template-dir is the directory where the
  1509.      templates will be found (if they are not in the standard
  1510.      directory).
  1511.  
  1512.    Example:
  1513.  
  1514.      CNpersistent MyClass
  1515.  
  1516. creates the class/extension files `PMyClass.h' and `PMyClass.c'.
  1517. MyClass and CNPObjectID will be the base classes to the new extension.
  1518. The only methods that have to be defined after this are the read_from
  1519. constructor and the storer-method.
  1520.  
  1521. NOTE:
  1522.    * At some classes it will be necessary to achieve direct access to
  1523.      some private members of the base class, e.g. for the read_from
  1524.      constructor or the storer-method. In order to achieve this it is
  1525.      important to declare the persistent class or extension as friend
  1526.      class at the base class.
  1527.  
  1528.    * All extensions have the complete Default I/O member function for
  1529.      CNCL classes. In most cases this I/O is not necessary because all
  1530.      these functions are already defined in the base class.  Thus all
  1531.      of them can be deleted (they are marked with the note ( to be
  1532.      deleted if not needed )).
  1533.  
  1534.    * Please don't wonder that the rule of no multiple inheritance
  1535.      inside of CNCL seems to be broken at the persistent classes. The
  1536.      second base class, `CNPObjectID', is not derived from any other
  1537.      CNCL-class. So the problems of multiple inheritance can not occur.
  1538.  
  1539. * Menu:
  1540.  
  1541. Persistent
  1542. ---------
  1543. * CNReaderTbl::         Table for adress of reader-function
  1544. * CNPObjectID::         ID-Managment for persistent Objects
  1545. * CNPIO::        persistent stream Object IO-formatting
  1546. * CNPstream::           abstract base class for persistent stream classes
  1547. * CNPiostream::         persistent iostream format
  1548. * CNPInt::              class persistent CNInt
  1549. * Other CNP<type>::     Other persistent classes
  1550.  
  1551. 
  1552. File: cncl.info,  Node: CNReaderTbl,  Next: CNPObjectID,  Prev: CNFNumTriangle,  Up: Persistent
  1553.  
  1554. CNReaderTbl - Table for adress of reader-function
  1555. =================================================
  1556.  
  1557. SYNOPSIS
  1558. --------
  1559.  
  1560.    `#include <CNCL/ReaderTbl.h>'
  1561.  
  1562. TYPE
  1563. ----
  1564.  
  1565.    `CN_READERTBL'
  1566.  
  1567. * Menu:
  1568.  
  1569. BASE CLASSES
  1570. ------------
  1571. * CNCL::        CNCL Static Members and Functions
  1572.  
  1573. DERIVED CLASSES
  1574. ---------------
  1575.  
  1576. RELATED CLASSES
  1577. ---------------
  1578.  
  1579. DESCRIPTION
  1580. -----------
  1581.  
  1582.    `CNReaderTbl' provides a table of all persistent classes
  1583. (`Reader-Table') and a second table of id's `ID-Table'. Both tables are
  1584. realized as dynamic hash-tables.
  1585.  
  1586.    The first one uses the classname as key for registering in the table,
  1587. the object stored in it is the reader function pointer (the adress of
  1588. the reader-function). This table is for checking if a class is
  1589. registered to be persistent and for calling the reader constructor when
  1590. objects are taken from the stream.
  1591.  
  1592.    The other table uses the id as key and stores the according object to
  1593. this id. The table is used during two occasions. First whenever an
  1594. object is written to the stream the id is stored in this table. When
  1595. the same object should be stored again it will be recognized. In
  1596. addition to the id a special delimitation character is used for
  1597. indicating this. When the objects are taken from the stream all objects
  1598. and their old id are stored in this table again. When this special
  1599. delimitation character apears on the stream the object can be taken out
  1600. of the table by its id. Thus it is possible to restore containers even
  1601. if one object appears several times at different locations, e.g at a
  1602. double linked list.
  1603.  
  1604.    Constructors:
  1605.  
  1606. `CNReaderTbl(char* classname, Reader_ptr reader_ptr);'
  1607.      Initializes a new Reader Table entry. Each given `classname' is
  1608.      added to the table.
  1609.  
  1610. Additional types provided by `CNReaderTbl' are:
  1611.  
  1612. `typedef CNObject*(*Reader_ptr)(CNPstream&);'
  1613.      This is the type for the reader-function-pointer.
  1614.  
  1615. The functions provided by `CNReaderTbl' are:
  1616.  
  1617. `static Reader_ptr reader_pointer_by_classname(char* classname);'
  1618.      This function checks if the requested `classname' is registered in
  1619.      the Reader Table and returns the according Reader_ptr. If it is not
  1620.      registered,  a fatal error is yielded.
  1621.  
  1622. `static bool is_in(long id_key);'
  1623.      Checks if the given `id_key' is in the id table.
  1624.  
  1625. `static void add_to_id_tbl(long id_key, CNObject* obj);'
  1626. `static void add_to_id_tbl(long id_key, CNObject& obj);'
  1627.      Adds the persistent object `obj' to the id table with `id_key' as
  1628.      its key.
  1629.  
  1630. `static CNObject* get_from_id_tbl(long id_key);'
  1631.      Returns the persistent object stored in the id table with `id_key'
  1632.      as the key.
  1633.  
  1634. `static void reset_id_tbl();'
  1635.      Resets the id table to its initial state (all stored elemts are
  1636.      deleted).  This method should be used if You change from the
  1637.      `write-to-stream' to the `read_from_stream' sequence.
  1638.  
  1639. 
  1640. File: cncl.info,  Node: CNPObjectID,  Next: CNPIO,  Prev: CNReaderTbl,  Up: Persistent
  1641.  
  1642. PObjectID -- ID-Managment for persistent Objects
  1643. ================================================
  1644.  
  1645. SYNOPSIS
  1646. --------
  1647.  
  1648.    `#include <CNCL/PObjectID.h>'
  1649.  
  1650. TYPE
  1651. ----
  1652.  
  1653. * Menu:
  1654.  
  1655. BASE CLASSES
  1656. ------------
  1657.  
  1658. DERIVED CLASSES
  1659. ---------------
  1660.  
  1661. RELATED CLASSES
  1662. ---------------
  1663.  
  1664. DESCRIPTION
  1665. -----------
  1666.  
  1667.    This class manages the (unique) identification number of each
  1668. persistent object. All persistent classes must be derived from this
  1669. class. As `CNPObjectID' is not derived from any CNCL-class `multiple
  1670. inheritance' can be used.
  1671.  
  1672.    One of the member variables, declared as static, is the counter for
  1673. the actual id. It is increased whenever a new id is given to an object.
  1674. The other one is the id of the object itself. This number cannot occur
  1675. two times inside of one program.
  1676.  
  1677.    Constructors:
  1678.  
  1679. `CNPObjectID();'
  1680.      Initializes the id and increases the `static' counter. This
  1681.      constructor must be called in all constructors of the derived
  1682.      classes.
  1683.  
  1684. Additional types provided by `CNReaderTbl' are:
  1685. `typedef long PID'
  1686.      For a possible future change from long to any other larger number
  1687.      this typedef has been included.
  1688.  
  1689.    `CNPObjectID' provides the following functions:
  1690.  
  1691. `CNPID object_id();'
  1692.      Returns the object id.
  1693.  
  1694. 
  1695. File: cncl.info,  Node: CNPIO,  Next: CNPstream,  Prev: CNPObjectID,  Up: Persistent
  1696.  
  1697. CNPIO -- persistent stream Object IO-formatting
  1698. ===============================================
  1699.  
  1700. SYNOPSIS
  1701. --------
  1702.  
  1703.    `#include <CNCL/PIO.h>'
  1704.  
  1705. TYPE
  1706. ----
  1707.  
  1708.    `CN_PIO'
  1709.  
  1710. * Menu:
  1711.  
  1712. BASE CLASSES
  1713. ------------
  1714. * CNCL::        CNCL Static Members and Functions
  1715.  
  1716.  
  1717. DERIVED CLASSES
  1718. ---------------
  1719.  
  1720. RELATED CLASSES
  1721. ---------------
  1722.  
  1723. DESCRIPTION
  1724. -----------
  1725.  
  1726.    `CNPIO' provides the format of storing and reading the persistent
  1727. objects on/from a stream.The format convention can be described as
  1728. follows:
  1729. `classname'
  1730. `delimitation character'
  1731. `data'
  1732. `delimitation character'
  1733.  
  1734. The functions provided by `CNPIO' are:
  1735.  
  1736. `static int store_object(CNPstream& stream, CNObject& obj, bool no_ptr_check = FALSE);'
  1737. `static CNObject* read_object(CNPstream& stream);'
  1738.      Reads/Stores a persistent `CNObject' on the `stream'. A `CNObject'
  1739.      is recognized to be persistent if it is registered at the actual
  1740.      `Reader Table'. `no_ptr_check' determines if the objects are
  1741.      checked for multiple appearence (`no_ptr_check = FALSE') or not
  1742.      (`TRUE').
  1743.  
  1744.      Stores the id of the persistent object `obj' to the given stream.
  1745.  
  1746. `static CNPID read_id(CNPstream& stream);'
  1747.      Reads the id from a stream.
  1748.  
  1749. 
  1750. File: cncl.info,  Node: CNPstream,  Next: CNPiostream,  Prev: CNPIO,  Up: Persistent
  1751.  
  1752. CNPstream -- abstract base class for persistent stream classes
  1753. ==============================================================
  1754.  
  1755. SYNOPSIS
  1756. --------
  1757.  
  1758.    `#include <CNCL/Pstream.h>'
  1759.  
  1760. TYPE
  1761. ----
  1762.  
  1763.    `CN_PSTREAM'
  1764.  
  1765. * Menu:
  1766.  
  1767. BASE CLASSES
  1768. ------------
  1769. * CNObject::        Root of the CNCL Hierarchy
  1770.  
  1771. DERIVED CLASSES
  1772. ---------------
  1773.  
  1774. RELATED CLASSES
  1775. ---------------
  1776.  
  1777. DESCRIPTION
  1778. -----------
  1779.  
  1780.    `CNPstream' is the abstract base class for the persistent stream
  1781. classes. Thus, only IO-operators and IO-functions are defined here. The
  1782. concrete definition of the methods and operators must be done in the
  1783. derived classes. Thus by this approach the possibilities of
  1784. polymorphism are kept.
  1785.  
  1786.    Constructors:
  1787.  
  1788. `CNPstream();'
  1789. `CNPstream(*param);'
  1790.      Initializes the `CNPstream'.
  1791.  
  1792. In addition to the member functions required by CNCL, `CNstream'
  1793. provides:
  1794.  
  1795. `virtual CNPstream& operator<<(const char*)=0;'
  1796. `virtual CNPstream& operator<<(char)=0;'
  1797. `virtual CNPstream& operator<<(long)=0;'
  1798. `virtual CNPstream& operator<<(double)=0;'
  1799. `virtual CNPstream& operator>>(char*)=0;'
  1800. `virtual CNPstream& operator>>(char&)=0;'
  1801. `virtual CNPstream& operator>>(long&)=0;'
  1802. `virtual CNPstream& operator>>(double&)=0;'
  1803.      Virtual persistent IO operators.
  1804.  
  1805. `virtual CNPstream& getline(char*, int ) = 0;'
  1806.      Virtual `getline' function for string input.
  1807.  
  1808. 
  1809. File: cncl.info,  Node: CNPiostream,  Next: CNPInt,  Prev: CNPstream,  Up: Persistent
  1810.  
  1811. CNPiostream -- persistent iostream format
  1812. =========================================
  1813.  
  1814. SYNOPSIS
  1815. --------
  1816.  
  1817.    `#include <CNCL/Piostream.h>'
  1818.  
  1819. TYPE
  1820. ----
  1821.  
  1822.    `CN_PIOSTREAM'
  1823.  
  1824. * Menu:
  1825.  
  1826. BASE CLASSES
  1827. ------------
  1828. * CNPstream::        abstract base class for persistent stream classes
  1829.  
  1830. DERIVED CLASSES
  1831. ---------------
  1832.  
  1833. RELATED CLASSES
  1834. ---------------
  1835.  
  1836. DESCRIPTION
  1837. -----------
  1838.  
  1839.    The class `CNPiostream' manages the interface to the gnu c++
  1840. iostream library. Thus, all virtual functions of the base class
  1841. `CNPstream' are defined here. For a description see the base class.
  1842.  
  1843.    Constructors:
  1844.  
  1845. `CNPiostream(iostream& s);'
  1846. `CNPiostream(CNParam *param);'
  1847.      Initializes the `CNPiostream'.
  1848.  
  1849.